package com.wallace.downloadserver.netty

import java.util.*

/**
 * @Author: Wallace
 * @Description: Netty通道消息封装类
 * @Date: 2022/2/14 0:14
 * @Modified By:
 */
data class NettyMsg(
        /**
         * 所请求的方法URI
         */
        var methodURI: String = "",

        /**
         * 方法参数
         */
        var params: Map<String, Objects> = mapOf(),

        /**
         * 消息类型
         */
        var type: NettyMsgType = NettyMsgType.Default,

        /**
         * 消息内容
         */
        var content: String = "",
) {
    enum class NettyMsgType {
        /**
         * (server ⇄ client)
         */
        Request,

        /**
         * (server ⇄ client)
         */
        Response,

        /**
         * (client -> server)
         */
        Ping,

        /**
         * (server -> client)
         */
        Notification,

        /**
         * default
         */
        Default
    }
}
